﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlPermissionOfUserViewData.ascx.cs" Inherits="UserControl_ControlPermissionOfUserViewData" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>
<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxTreeList" TagPrefix="dxwtl" %>

<%@ Import Namespace="webapp4U" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<script type="text/javascript">
    function pageLoad() {

        $("#<%= imgBtnSave.ClientID %>").click(function() {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });

        
        $("#<%= btnSearch.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }
    }

</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <div class="direct_container_right_titletop">
            Phân quyền xem dữ liệu
        </div>
        <hr />
        <!-- Button chuc nang-->
        <div class="direct_container_main">
           
            <asp:ImageButton ID="imgBtnSave" ImageUrl="~/Images/save.png" Width="32px" Height="32px"
                runat="server" OnClick="imgBtnSave_Click" ToolTip="Lưu" />
            
        </div>
        <!-- End Button chuc nang-->
        <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" BackColor="#CCFFFF"
            Font-Names="Arial" Width="100%">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Phân quyền" TabIndex="0">
                <ContentTemplate>
                    <!-- Content main-->
                    <div class="direct_container_main">
                        <div class="direct_container_form_right">
                            <table border="0" width="100%">
                                <tr>
                                    <td colspan="4" align="center">
                                        <asp:Label ID="lblMsg" runat="server" Visible="false" BackColor="Silver" ForeColor="Blue" Font-Bold="true" Font-Italic="true"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" width="15%">
                                        <p class="direct_label">
                                            Chi nhánh</p>
                                    </td>
                                    <td align="left">
                                         <asp:Label ID="lblChiNhanh" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <p class="direct_label">
                                            Tên đăng nhập</p>
                                    </td>
                                    <td align="left">
                                         <asp:Label ID="lblUserName" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <p class="direct_label">
                                            Tên Người Dùng</p>
                                    </td>
                                    <td align="left">
                                         <asp:Label ID="lblDescription" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>                                
                                
                                <tr>
                                    <td align="right">
                                        <p class="direct_label">
                                            Thuộc nhóm</p>
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lblGroup" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right"> 
                                        <p class="direct_label">
                                            Phạm vi xem dữ liệu</p>                        
                                    </td>
                                    <td align="left">
                                        
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td align="right">
                                        
                                    </td>
                                    <td align="left">
                                        <dxwtl:ASPxTreeList ID="treeListTuyen" runat="server" AutoGenerateColumns="False" Width="100%"
                                             KeyFieldName="ADNCode" ParentFieldName="ParentADNCode" ClientInstanceName="treeListTuyen"
                                             >
                                            <Columns>
                                                <dxwtl:TreeListDataColumn FieldName="Tuyen" VisibleIndex="0" />            
                                                
                                            </Columns>
                                            <SettingsBehavior AllowFocusedNode="true" ExpandCollapseAction="NodeDblClick" AllowSort="False" />     
                                            
	                                        <Border BorderStyle="Groove" />
                                        
                                        </dxwtl:ASPxTreeList>

                                        
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <!-- EndContent main-->
                </ContentTemplate>
            </cc1:TabPanel>
            <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="Tìm kiếm" TabIndex="1">
                <ContentTemplate>
                    <div class="direct_container_form_right">
                        <table border="0" width="100%">
                            <tr>
                                <td align="left" style="width:150px;">
                                    <p class="direct_legend">
                                        Thuộc nhóm</p>
                                </td>
                                <td align="left">
                                    <p class="direct_legend">
                                        Nhập thông tin cần tìm</p>
                                </td>
                            </tr>
                            <tr>
                                <td valign="middle">
                                    <asp:DropDownList ID="ddlThuocNhom" CssClass="input_full" runat="server">
                                        </asp:DropDownList>                                    
                                </td>
                                <td>
                                    <asp:TextBox ID="txtSearch" CssClass="input_full" runat="server"></asp:TextBox>
                                    
                                    <asp:Button ID="btnSearch" CssClass="direct_bt_search" runat="server" CausesValidation="False"
                                        Text="Tìm kiếm" OnClick="btnSearch_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                   <asp:GridView ID="grvUser" runat="server" AutoGenerateColumns="False" 
                                                        DataKeyNames="UserName" EnableModelValidation="True" 
                                                        OnPageIndexChanging="grvUser_PageIndexChanging" 
                                                        onrowcommand="grvUser_RowCommand" AllowPaging="True">
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="Stt">
                                                                <HeaderTemplate>
                                                                    STT
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Tên đăng nhập">
                                                                <HeaderTemplate>
                                                                    Tên đăng nhập
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                  
                                                                      <asp:Label ID="lblUser" runat="server" Text='<%# Eval("UserName")%>'></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                            
                                                             <asp:TemplateField HeaderText="Họ tên">
                                                                <HeaderTemplate>
                                                                    Họ tên
                                                                </HeaderTemplate>
                                                                <ItemTemplate>   
                                                                        <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("UserDescription")%>'></asp:Label> 
                                                                      
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="250px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="250px" />
                                                            </asp:TemplateField>
                                                           
                                                             <asp:TemplateField HeaderText="Cơ sở">
                                                                <HeaderTemplate>
                                                                   Chi nhánh
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblSiteName" runat="server" Text='<%# Eval("sitename")%>'></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                            
                                                            <asp:TemplateField HeaderText="Group" Visible="false">
                                                                <HeaderTemplate>
                                                                   Group
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblgroup" runat="server" Text='<%# Eval("TypeName")%>'></asp:Label>                                                                    
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                            
                                                            <asp:TemplateField HeaderText="ADNCode" Visible="false">
                                                                <HeaderTemplate>
                                                                   ADNCode
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblADNCode" runat="server" Text='<%# Eval("ADNCode")%>'></asp:Label>                                                                    
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField>
                                                                 <ItemTemplate>
                                                                    <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" 
                                                                    CommandName="chon" Height="20px" ImageUrl="~/Images/check.png" />
                                                                </ItemTemplate>
                                                                <ControlStyle BackColor="White" BorderColor="White" />
                                                                <FooterStyle BackColor="White" BorderColor="White" />
                                                                <HeaderStyle BackColor="White" BorderColor="White" />
                                                                <ItemStyle BackColor="White" BorderColor="White" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                </td>
                            </tr>
                        </table>
                    </div>
                    </div>
                </ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer>
        <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
            Width="601px">
            <ContentCollection>
                <dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
            </ContentCollection>
        </dxpc:ASPxPopupControl>
    </ContentTemplate>
</asp:UpdatePanel>